<template>
  <div>
    时间字符串：
    <el-input style="width:50%;" size="mini" v-model="timeStr"/><br/>
    模式：
    <el-input style="width:40%;" size="mini" v-model="timeModel"/><br/>
    <el-button size="mini" type="primary" @click="formatDate">转换</el-button><br/>
    结果：
    <el-input style="width:80%;" size="mini" v-model="timeRes" readonly/>
  </div>
</template>
<script>
import { parseTime } from '../../utils'
export default {
  data() {
    return {
      timeStr: '2023/12/07 18:03:50',
      timeModel: '{y}-{m}-{d} {h}:{i}:{s}',
      timeRes: ''
    }
  },
  methods: {
    formatDate() {
      this.timeRes = parseTime(this.timeStr, this.timeModel)
    },
  }
}
</script>